local sk__huage = fk.CreateSkill {

  name = "sk__huage",

  tags = {  },

}



sk__huage:addEffect("active", {
  name = "sk__huage",
  anim_type = "control",
  card_num = 0,
  target_num = 0,
  prompt = "#sk__huage",
  can_use = function(self, player)
    return player:usedSkillTimes(sk__huage.name, Player.HistoryPhase) == 0 and
      table.find(Fk:currentRoom().alive_players, function (p)
        return not p:isNude()
      end)
  end,
  card_filter = Util.FalseFunc,
  on_use = function(self, room, effect)
    local player = reffect.from
    local targets = room:getAlivePlayers()
    room:doIndicate(player.id, table.map(targets, Util.IdMapper))
    for _, target in ipairs(targets) do
      if not target.dead and not target:isNude() then
        local cards = room:askForDiscard(target, 1, 999, true, sk__huage.name, false, ".", "#sk__huage-discard")
        local n = #table.filter(cards, function(id)
          return Fk:getCardById(id).trueName == "slash"
        end)
        if n > 0 and not target.dead then
          target:drawCards(n, sk__huage.name)
        end
      end
    end
  end,
})

return sk__huage